package com.wenhai.spring.boot.controller;

import com.wenhai.spring.boot.domain.Save;
import com.wenhai.spring.boot.domain.User;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;

@Validated
@RestController
public class UserController {


    @NotNull(message = "没有成功")
    @PostMapping("/user/add")
    public User add(@Validated(Save.class) @RequestBody User user) {
        return null;
    }
}
